package Menus;

import Global.*;
import jplay.Window;
import jplay.Keyboard;
import jplay.ParallaxLayers;

public class Intro {

    Keyboard joystick;
    Window window = new FPSWindow(800, 600);
    ParallaxLayers pIntro = GlobalParallax.addBackground("img/menuIntro.png");

    public Intro() {
        load();
        loop();
    }

    private void load() {
        GlobalWindow.window = window;
        pIntro.draw();
    }

    private void loop() {
        joystick = window.getKeyboard();

        while (GlobalWindow.alive) {
            GlobalWindow.update();

            if (joystick.keyDown(Keyboard.ENTER_KEY)) {
                // Aqui vai menu principal
                window.update();
            } else if (joystick.keyDown(Keyboard.ESCAPE_KEY)) {
                window.exit();
            }
        }
    }
}
